home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / AppleEvents.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  18.5 KB  |  767 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        AppleEvents.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  18. __APPLEEVENTS__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  22.     include 'Errors.a'
  23.     ENDIF
  24. ;        include 'ConditionalMacros.a'                                ;
  25.  
  26.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  27.     include 'Types.a'
  28.     ENDIF
  29.  
  30.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  31.     include 'Memory.a'
  32.     ENDIF
  33. ;        include 'MixedMode.a'                                        ;
  34.  
  35.     IF &TYPE('__OSUTILS__') = 'UNDEFINED' THEN
  36.     include 'OSUtils.a'
  37.     ENDIF
  38.  
  39.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  40.     include 'Events.a'
  41.     ENDIF
  42. ;        include 'Quickdraw.a'                                        ;
  43. ;            include 'QuickdrawText.a'                                ;
  44.  
  45.     IF &TYPE('__EPPC__') = 'UNDEFINED' THEN
  46.     include 'EPPC.a'
  47.     ENDIF
  48. ;        include 'PPCToolbox.a'                                        ;
  49. ;            include 'AppleTalk.a'                                    ;
  50. ;        include 'Processes.a'                                        ;
  51. ;            include 'Files.a'                                        ;
  52.  
  53.     IF &TYPE('__NOTIFICATION__') = 'UNDEFINED' THEN
  54.     include 'Notification.a'
  55.     ENDIF
  56.  
  57. ; Apple event descriptor types 
  58. typeBoolean                        EQU        'bool'
  59. typeChar                        EQU        'TEXT'
  60. typeSMInt                        EQU        'shor'
  61. typeInteger                        EQU        'long'
  62. typeSMFloat                        EQU        'sing'
  63. typeFloat                        EQU        'doub'
  64. typeLongInteger                    EQU        'long'
  65. typeShortInteger                EQU        'shor'
  66. typeLongFloat                    EQU        'doub'
  67. typeShortFloat                    EQU        'sing'
  68. typeExtended                    EQU        'exte'
  69. typeComp                        EQU        'comp'
  70. typeMagnitude                    EQU        'magn'
  71. typeAEList                        EQU        'list'
  72. typeAERecord                    EQU        'reco'
  73. typeAppleEvent                    EQU        'aevt'
  74. typeTrue                        EQU        'true'
  75. typeFalse                        EQU        'fals'
  76. typeAlias                        EQU        'alis'
  77. typeEnumerated                    EQU        'enum'
  78. typeType                        EQU        'type'
  79. typeAppParameters                EQU        'appa'
  80. typeProperty                    EQU        'prop'
  81. typeFSS                            EQU        'fss '
  82. typeKeyword                        EQU        'keyw'
  83. typeSectionH                    EQU        'sect'
  84. typeWildCard                    EQU        '****'
  85. typeApplSignature                EQU        'sign'
  86. typeQDRectangle                    EQU        'qdrt'
  87. typeFixed                        EQU        'fixd'
  88. typeSessionID                    EQU        'ssid'
  89. typeTargetID                    EQU        'targ'
  90. typeProcessSerialNumber            EQU        'psn '
  91. typeNull                        EQU        'null'                ; null or nonexistent data 
  92. ; Keywords for Apple event parameters 
  93. keyDirectObject                    EQU        '----'
  94. keyErrorNumber                    EQU        'errn'
  95. keyErrorString                    EQU        'errs'
  96. keyProcessSerialNumber            EQU        'psn '
  97. ; Keywords for Apple event attributes 
  98. keyTransactionIDAttr            EQU        'tran'
  99. keyReturnIDAttr                    EQU        'rtid'
  100. keyEventClassAttr                EQU        'evcl'
  101. keyEventIDAttr                    EQU        'evid'
  102. keyAddressAttr                    EQU        'addr'
  103. keyOptionalKeywordAttr            EQU        'optk'
  104. keyTimeoutAttr                    EQU        'timo'
  105. keyInteractLevelAttr            EQU        'inte'                ; this attribute is read only - will be set in AESend 
  106. keyEventSourceAttr                EQU        'esrc'                ; this attribute is read only 
  107. keyMissedKeywordAttr            EQU        'miss'                ; this attribute is read only 
  108. keyOriginalAddressAttr            EQU        'from'                ; new in 1.0.1 
  109. ; Keywords for special handlers 
  110. keyPreDispatch                    EQU        'phac'                ; preHandler accessor call 
  111. keySelectProc                    EQU        'selh'                ; more selector call 
  112. ; Keyword for recording 
  113. keyAERecorderCount                EQU        'recr'                ; available only in vers 1.0.1 and greater 
  114. ; Keyword for version information 
  115. keyAEVersion                    EQU        'vers'                ; available only in vers 1.0.1 and greater 
  116. ; Event Class 
  117. kCoreEventClass                    EQU        'aevt'
  118. ; Event ID’s 
  119. kAEOpenApplication                EQU        'oapp'
  120. kAEOpenDocuments                EQU        'odoc'
  121. kAEPrintDocuments                EQU        'pdoc'
  122. kAEQuitApplication                EQU        'quit'
  123. kAEAnswer                        EQU        'ansr'
  124. kAEApplicationDied                EQU        'obit'
  125.  
  126. ; Constants for use in AESend mode 
  127. kAENoReply                        EQU        $00000001            ; sender doesn't want a reply to event 
  128. kAEQueueReply                    EQU        $00000002            ; sender wants a reply but won't wait 
  129. kAEWaitReply                    EQU        $00000003            ; sender wants a reply and will wait 
  130. kAENeverInteract                EQU        $00000010            ; server should not interact with user 
  131. kAECanInteract                    EQU        $00000020            ; server may try to interact with user 
  132. kAEAlwaysInteract                EQU        $00000030            ; server should always interact with user where appropriate 
  133. kAECanSwitchLayer                EQU        $00000040            ; interaction may switch layer 
  134. kAEDontReconnect                EQU        $00000080            ; don't reconnect if there is a sessClosedErr from PPCToolbox 
  135. kAEWantReceipt                    EQU        nReturnReceipt        ; sender wants a receipt of message 
  136. kAEDontRecord                    EQU        $00001000            ; don't record this event - available only in vers 1.0.1 and greater 
  137. kAEDontExecute                    EQU        $00002000            ; don't send the event for recording - available only in vers 1.0.1 and greater 
  138. ; Constants for the send priority in AESend 
  139. kAENormalPriority                EQU        $00000000            ; post message at the end of the event queue 
  140. kAEHighPriority                    EQU        nAttnMsg            ; post message at the front of the event queue 
  141.  
  142. ; Constants for recording 
  143. kAEStartRecording                EQU        'reca'                ; available only in vers 1.0.1 and greater 
  144. kAEStopRecording                EQU        'recc'                ; available only in vers 1.0.1 and greater 
  145. kAENotifyStartRecording            EQU        'rec1'                ; available only in vers 1.0.1 and greater 
  146. kAENotifyStopRecording            EQU        'rec0'                ; available only in vers 1.0.1 and greater 
  147. kAENotifyRecording                EQU        'recr'
  148.  
  149. ; Constant for the returnID param of AECreateAppleEvent 
  150. kAutoGenerateReturnID            EQU        -1                    ; AECreateAppleEvent will generate a session-unique ID 
  151. ; Constant for transaction ID’s 
  152. kAnyTransactionID                EQU        0                    ; no transaction is in use 
  153. ; Constants for timeout durations 
  154. kAEDefaultTimeout                EQU        -1                    ; timeout value determined by AEM 
  155. kNoTimeOut                        EQU        -2                    ; wait until reply comes back, however long it takes 
  156.  
  157. ; Constants for AEResumeTheCurrentEvent 
  158. kAENoDispatch                    EQU        0                    ; dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch 
  159. kAEUseStandardDispatch            EQU        $FFFFFFFF            ; table, or one of these two constants 
  160. ; Constants for Refcon in AEResumeTheCurrentEvent with kAEUseStandardDispatch 
  161. kAEDoNotIgnoreHandler            EQU        $00000000
  162. kAEIgnoreAppPhacHandler            EQU        $00000001            ; available only in vers 1.0.1 and greater 
  163. kAEIgnoreAppEventHandler        EQU        $00000002            ; available only in vers 1.0.1 and greater 
  164. kAEIgnoreSysPhacHandler            EQU        $00000004            ; available only in vers 1.0.1 and greater 
  165. kAEIgnoreSysEventHandler        EQU        $00000008            ; available only in vers 1.0.1 and greater 
  166. kAEIngoreBuiltInEventHandler    EQU        $00000010            ; available only in vers 1.0.1 and greater 
  167. kAEDontDisposeOnResume            EQU        $80000000            ; available only in vers 1.0.1 and greater 
  168.  
  169. ; Apple event manager data types 
  170. AEDesc                     RECORD    0
  171. descriptorType             ds.l    1
  172. dataHandle                 ds.l    1
  173. sizeof                     EQU    8
  174.                         ENDR
  175.  
  176. AEKeyDesc                 RECORD    0
  177. descKey                     ds.l    1
  178. descContent                 ds        AEDesc
  179. sizeof                     EQU    12
  180.                         ENDR
  181.  
  182. ; an AEDesc which contains address data 
  183. ; a list of AEDesc's is a special kind of AEDesc 
  184. ; AERecord is a list of keyworded AEDesc's 
  185. ; an AERecord that contains an AppleEvent 
  186. ; parameter to AESend 
  187. ; priority param of AESend 
  188.  
  189. kAEInteractWithSelf                EQU        0
  190. kAEInteractWithLocal            EQU        1
  191. kAEInteractWithAll                EQU        2
  192.  
  193. kAEUnknownSource                EQU        0
  194. kAEDirectCall                    EQU        1
  195. kAESameProcess                    EQU        2
  196. kAELocalProcess                    EQU        3
  197. kAERemoteProcess                EQU        4
  198.  
  199. kAEDataArray                    EQU        0
  200. kAEPackedArray                    EQU        1
  201. kAEHandleArray                    EQU        2
  202. kAEDescArray                    EQU        3
  203. kAEKeyDescArray                    EQU        4
  204.  
  205. AEArrayData             RECORD    0
  206. VariantLevel0Begin        EQU    *
  207. kAEDataArray             ds.w    1
  208.                         ORG        VariantLevel0Begin
  209. kAEPackedArray             ds.b    1
  210.                         ORG        VariantLevel0Begin
  211. kAEHandleArray             ds.l    1
  212.                         ORG        VariantLevel0Begin
  213. kAEDescArray             ds        AEDesc
  214.                         ORG        VariantLevel0Begin
  215. kAEKeyDescArray             ds        AEKeyDesc
  216. sizeof                     EQU    12
  217.                         ENDR
  218.  
  219. ;*************************************************************************
  220. ; The following calls apply to any AEDesc. Every 'result' descriptor is
  221. ; created for you, so you will be responsible for memory management
  222. ; (including disposing) of the descriptors so created. Note: purgeable
  223. ; descriptor data is not supported - the AEM does not call LoadResource.  
  224. ;*************************************************************************
  225.     IF GENERATING68K THEN
  226.         Macro
  227.         _AECreateDesc
  228.             move.w    #$0825,d0
  229.             dc.w     $A816
  230.         EndM
  231.     ELSE
  232.         IMPORT    AECreateDesc
  233.     ENDIF
  234.  
  235.     IF GENERATING68K THEN
  236.         Macro
  237.         _AECoercePtr
  238.             move.w    #$0A02,d0
  239.             dc.w     $A816
  240.         EndM
  241.     ELSE
  242.         IMPORT    AECoercePtr
  243.     ENDIF
  244.  
  245.     IF GENERATING68K THEN
  246.         Macro
  247.         _AECoerceDesc
  248.             move.w    #$0603,d0
  249.             dc.w     $A816
  250.         EndM
  251.     ELSE
  252.         IMPORT    AECoerceDesc
  253.     ENDIF
  254.  
  255.     IF GENERATING68K THEN
  256.         Macro
  257.         _AEDisposeDesc
  258.             move.w    #$0204,d0
  259.             dc.w     $A816
  260.         EndM
  261.     ELSE
  262.         IMPORT    AEDisposeDesc
  263.     ENDIF
  264.  
  265.     IF GENERATING68K THEN
  266.         Macro
  267.         _AEDuplicateDesc
  268.             move.w    #$0405,d0
  269.             dc.w     $A816
  270.         EndM
  271.     ELSE
  272.         IMPORT    AEDuplicateDesc
  273.     ENDIF
  274.  
  275. ;*************************************************************************
  276. ;  The following calls apply to AEDescList. Since AEDescList is a subtype of
  277. ;  AEDesc, the calls in the previous section can also be used for AEDescList.
  278. ;  All list and array indices are 1-based. If the data was greater than
  279. ;  maximumSize in the routines below, then actualSize will be greater than
  280. ;  maximumSize, but only maximumSize bytes will actually be retrieved.
  281. ;*************************************************************************
  282.     IF GENERATING68K THEN
  283.         Macro
  284.         _AECreateList
  285.             move.w    #$0706,d0
  286.             dc.w     $A816
  287.         EndM
  288.     ELSE
  289.         IMPORT    AECreateList
  290.     ENDIF
  291.  
  292.     IF GENERATING68K THEN
  293.         Macro
  294.         _AECountItems
  295.             move.w    #$0407,d0
  296.             dc.w     $A816
  297.         EndM
  298.     ELSE
  299.         IMPORT    AECountItems
  300.     ENDIF
  301.  
  302.     IF GENERATING68K THEN
  303.         Macro
  304.         _AEPutPtr
  305.             move.w    #$0A08,d0
  306.             dc.w     $A816
  307.         EndM
  308.     ELSE
  309.         IMPORT    AEPutPtr
  310.     ENDIF
  311.  
  312.     IF GENERATING68K THEN
  313.         Macro
  314.         _AEPutDesc
  315.             move.w    #$0609,d0
  316.             dc.w     $A816
  317.         EndM
  318.     ELSE
  319.         IMPORT    AEPutDesc
  320.     ENDIF
  321.  
  322.     IF GENERATING68K THEN
  323.         Macro
  324.         _AEGetNthPtr
  325.             move.w    #$100A,d0
  326.             dc.w     $A816
  327.         EndM
  328.     ELSE
  329.         IMPORT    AEGetNthPtr
  330.     ENDIF
  331.  
  332.     IF GENERATING68K THEN
  333.         Macro
  334.         _AEGetNthDesc
  335.             move.w    #$0A0B,d0
  336.             dc.w     $A816
  337.         EndM
  338.     ELSE
  339.         IMPORT    AEGetNthDesc
  340.     ENDIF
  341.  
  342.     IF GENERATING68K THEN
  343.         Macro
  344.         _AESizeOfNthItem
  345.             move.w    #$082A,d0
  346.             dc.w     $A816
  347.         EndM
  348.     ELSE
  349.         IMPORT    AESizeOfNthItem
  350.     ENDIF
  351.  
  352.     IF GENERATING68K THEN
  353.         Macro
  354.         _AEGetArray
  355.             move.w    #$0D0C,d0
  356.             dc.w     $A816
  357.         EndM
  358.     ELSE
  359.         IMPORT    AEGetArray
  360.     ENDIF
  361.  
  362.     IF GENERATING68K THEN
  363.         Macro
  364.         _AEPutArray
  365.             move.w    #$0B0D,d0
  366.             dc.w     $A816
  367.         EndM
  368.     ELSE
  369.         IMPORT    AEPutArray
  370.     ENDIF
  371.  
  372.     IF GENERATING68K THEN
  373.         Macro
  374.         _AEDeleteItem
  375.             move.w    #$040E,d0
  376.             dc.w     $A816
  377.         EndM
  378.     ELSE
  379.         IMPORT    AEDeleteItem
  380.     ENDIF
  381.  
  382. ;*************************************************************************
  383. ; The following calls apply to AERecord. Since AERecord is a subtype of
  384. ; AEDescList, the calls in the previous sections can also be used for
  385. ; AERecord an AERecord can be created by using AECreateList with isRecord
  386. ; set to true. 
  387. ;*************************************************************************
  388.     IF GENERATING68K THEN
  389.         Macro
  390.         _AEPutParamPtr
  391.             move.w    #$0A0F,d0
  392.             dc.w     $A816
  393.         EndM
  394.     ELSE
  395.         IMPORT    AEPutParamPtr
  396.     ENDIF
  397.  
  398.     IF GENERATING68K THEN
  399.         Macro
  400.         _AEPutParamDesc
  401.             move.w    #$0610,d0
  402.             dc.w     $A816
  403.         EndM
  404.     ELSE
  405.         IMPORT    AEPutParamDesc
  406.     ENDIF
  407.  
  408.     IF GENERATING68K THEN
  409.         Macro
  410.         _AEGetParamPtr
  411.             move.w    #$0E11,d0
  412.             dc.w     $A816
  413.         EndM
  414.     ELSE
  415.         IMPORT    AEGetParamPtr
  416.     ENDIF
  417.  
  418.     IF GENERATING68K THEN
  419.         Macro
  420.         _AEGetParamDesc
  421.             move.w    #$0812,d0
  422.             dc.w     $A816
  423.         EndM
  424.     ELSE
  425.         IMPORT    AEGetParamDesc
  426.     ENDIF
  427.  
  428.     IF GENERATING68K THEN
  429.         Macro
  430.         _AESizeOfParam
  431.             move.w    #$0829,d0
  432.             dc.w     $A816
  433.         EndM
  434.     ELSE
  435.         IMPORT    AESizeOfParam
  436.     ENDIF
  437.  
  438.     IF GENERATING68K THEN
  439.         Macro
  440.         _AEDeleteParam
  441.             move.w    #$0413,d0
  442.             dc.w     $A816
  443.         EndM
  444.     ELSE
  445.         IMPORT    AEDeleteParam
  446.     ENDIF
  447.  
  448. ;*************************************************************************
  449. ; The following calls also apply to type AppleEvent. Message attributes are
  450. ; far more restricted, and can only be accessed through the following 5
  451. ; calls. The various list and record routines cannot be used to access the
  452. ; attributes of an event. 
  453. ;*************************************************************************
  454.     IF GENERATING68K THEN
  455.         Macro
  456.         _AEGetAttributePtr
  457.             move.w    #$0E15,d0
  458.             dc.w     $A816
  459.         EndM
  460.     ELSE
  461.         IMPORT    AEGetAttributePtr
  462.     ENDIF
  463.  
  464.     IF GENERATING68K THEN
  465.         Macro
  466.         _AEGetAttributeDesc
  467.             move.w    #$0826,d0
  468.             dc.w     $A816
  469.         EndM
  470.     ELSE
  471.         IMPORT    AEGetAttributeDesc
  472.     ENDIF
  473.  
  474.     IF GENERATING68K THEN
  475.         Macro
  476.         _AESizeOfAttribute
  477.             move.w    #$0828,d0
  478.             dc.w     $A816
  479.         EndM
  480.     ELSE
  481.         IMPORT    AESizeOfAttribute
  482.     ENDIF
  483.  
  484.     IF GENERATING68K THEN
  485.         Macro
  486.         _AEPutAttributePtr
  487.             move.w    #$0A16,d0
  488.             dc.w     $A816
  489.         EndM
  490.     ELSE
  491.         IMPORT    AEPutAttributePtr
  492.     ENDIF
  493.  
  494.     IF GENERATING68K THEN
  495.         Macro
  496.         _AEPutAttributeDesc
  497.             move.w    #$0627,d0
  498.             dc.w     $A816
  499.         EndM
  500.     ELSE
  501.         IMPORT    AEPutAttributeDesc
  502.     ENDIF
  503.  
  504. ;*************************************************************************
  505. ;  The next couple of calls are basic routines used to create, send,
  506. ;  and process AppleEvents. 
  507. ;*************************************************************************
  508.     IF GENERATING68K THEN
  509.         Macro
  510.         _AECreateAppleEvent
  511.             move.w    #$0B14,d0
  512.             dc.w     $A816
  513.         EndM
  514.     ELSE
  515.         IMPORT    AECreateAppleEvent
  516.     ENDIF
  517.  
  518.     IF GENERATING68K THEN
  519.         Macro
  520.         _AESend
  521.             move.w    #$0D17,d0
  522.             dc.w     $A816
  523.         EndM
  524.     ELSE
  525.         IMPORT    AESend
  526.     ENDIF
  527.  
  528.     IF GENERATING68K THEN
  529.         Macro
  530.         _AEProcessAppleEvent
  531.             move.w    #$021B,d0
  532.             dc.w     $A816
  533.         EndM
  534.     ELSE
  535.         IMPORT    AEProcessAppleEvent
  536.     ENDIF
  537.  
  538. ; Note: during event processing, an event handler may realize that it is likely
  539. ; to exceed the client's timeout limit. Passing the reply to this
  540. ; routine causes a wait event to be generated that asks the client
  541. ; for more time. 
  542. ;
  543.     IF GENERATING68K THEN
  544.         Macro
  545.         _AEResetTimer
  546.             move.w    #$0219,d0
  547.             dc.w     $A816
  548.         EndM
  549.     ELSE
  550.         IMPORT    AEResetTimer
  551.     ENDIF
  552.  
  553. ;*************************************************************************
  554. ; The following four calls are available for applications which need more
  555. ; sophisticated control over when and how events are processed. Applications
  556. ; which implement multi-session servers or which implement their own
  557. ; internal event queueing will probably be the major clients of these
  558. ; routines. They can be called from within a handler to prevent the AEM from
  559. ; disposing of the AppleEvent when the handler returns. They can be used to
  560. ; asynchronously process the event (as MacApp does).
  561. ;*************************************************************************
  562.     IF GENERATING68K THEN
  563.         Macro
  564.         _AESuspendTheCurrentEvent
  565.             move.w    #$022B,d0
  566.             dc.w     $A816
  567.         EndM
  568.     ELSE
  569.         IMPORT    AESuspendTheCurrentEvent
  570.     ENDIF
  571.  
  572. ; Note: The following routine tells the AppleEvent manager that processing
  573. ; is either about to resume or has been completed on a previously suspended
  574. ; event. The procPtr passed in as the dispatcher parameter will be called to
  575. ; attempt to redispatch the event. Several constants for the dispatcher
  576. ; parameter allow special behavior. They are:
  577. ;      - kAEUseStandardDispatch means redispatch as if the event was just
  578. ;      received, using the standard AppleEvent dispatch mechanism.
  579. ;      - kAENoDispatch means ignore the parameter.
  580. ;         Use this in the case where the event has been handled and no
  581. ;      redispatch is needed.
  582. ;      - non nil means call the routine which the dispatcher points to.
  583. ;
  584.     IF GENERATING68K THEN
  585.         Macro
  586.         _AEResumeTheCurrentEvent
  587.             move.w    #$0818,d0
  588.             dc.w     $A816
  589.         EndM
  590.     ELSE
  591.         IMPORT    AEResumeTheCurrentEvent
  592.     ENDIF
  593.  
  594.     IF GENERATING68K THEN
  595.         Macro
  596.         _AEGetTheCurrentEvent
  597.             move.w    #$021A,d0
  598.             dc.w     $A816
  599.         EndM
  600.     ELSE
  601.         IMPORT    AEGetTheCurrentEvent
  602.     ENDIF
  603.  
  604.     IF GENERATING68K THEN
  605.         Macro
  606.         _AESetTheCurrentEvent
  607.             move.w    #$022C,d0
  608.             dc.w     $A816
  609.         EndM
  610.     ELSE
  611.         IMPORT    AESetTheCurrentEvent
  612.     ENDIF
  613.  
  614. ;*************************************************************************
  615. ;  The following three calls are used to allow applications to behave
  616. ;  courteously when a user interaction such as a dialog box is needed. 
  617. ;*************************************************************************
  618.     IF GENERATING68K THEN
  619.         Macro
  620.         _AEGetInteractionAllowed
  621.             move.w    #$021D,d0
  622.             dc.w     $A816
  623.         EndM
  624.     ELSE
  625.         IMPORT    AEGetInteractionAllowed
  626.     ENDIF
  627.  
  628.     IF GENERATING68K THEN
  629.         Macro
  630.         _AESetInteractionAllowed
  631.             move.w    #$011E,d0
  632.             dc.w     $A816
  633.         EndM
  634.     ELSE
  635.         IMPORT    AESetInteractionAllowed
  636.     ENDIF
  637.  
  638.     IF GENERATING68K THEN
  639.         Macro
  640.         _AEInteractWithUser
  641.             move.w    #$061C,d0
  642.             dc.w     $A816
  643.         EndM
  644.     ELSE
  645.         IMPORT    AEInteractWithUser
  646.     ENDIF
  647.  
  648. ;*************************************************************************
  649. ;  These calls are used to set up and modify the event dispatch table.
  650. ;*************************************************************************
  651.     IF GENERATING68K THEN
  652.         Macro
  653.         _AEInstallEventHandler
  654.             move.w    #$091F,d0
  655.             dc.w     $A816
  656.         EndM
  657.     ELSE
  658.         IMPORT    AEInstallEventHandler
  659.     ENDIF
  660.  
  661.     IF GENERATING68K THEN
  662.         Macro
  663.         _AERemoveEventHandler
  664.             move.w    #$0720,d0
  665.             dc.w     $A816
  666.         EndM
  667.     ELSE
  668.         IMPORT    AERemoveEventHandler
  669.     ENDIF
  670.  
  671.     IF GENERATING68K THEN
  672.         Macro
  673.         _AEGetEventHandler
  674.             move.w    #$0921,d0
  675.             dc.w     $A816
  676.         EndM
  677.     ELSE
  678.         IMPORT    AEGetEventHandler
  679.     ENDIF
  680.  
  681. ;*************************************************************************
  682. ;  These calls are used to set up and modify the coercion dispatch table.
  683. ;*************************************************************************
  684.     IF GENERATING68K THEN
  685.         Macro
  686.         _AEInstallCoercionHandler
  687.             move.w    #$0A22,d0
  688.             dc.w     $A816
  689.         EndM
  690.     ELSE
  691.         IMPORT    AEInstallCoercionHandler
  692.     ENDIF
  693.  
  694.     IF GENERATING68K THEN
  695.         Macro
  696.         _AERemoveCoercionHandler
  697.             move.w    #$0723,d0
  698.             dc.w     $A816
  699.         EndM
  700.     ELSE
  701.         IMPORT    AERemoveCoercionHandler
  702.     ENDIF
  703.  
  704.     IF GENERATING68K THEN
  705.         Macro
  706.         _AEGetCoercionHandler
  707.             move.w    #$0B24,d0
  708.             dc.w     $A816
  709.         EndM
  710.     ELSE
  711.         IMPORT    AEGetCoercionHandler
  712.     ENDIF
  713.  
  714. ;*************************************************************************
  715. ;  These calls are used to set up and modify special hooks into the
  716. ;  AppleEvent manager.
  717. ;*************************************************************************
  718.     IF GENERATING68K THEN
  719.         Macro
  720.         _AEInstallSpecialHandler
  721.             move.w    #$0500,d0
  722.             dc.w     $A816
  723.         EndM
  724.     ELSE
  725.         IMPORT    AEInstallSpecialHandler
  726.     ENDIF
  727.  
  728.     IF GENERATING68K THEN
  729.         Macro
  730.         _AERemoveSpecialHandler
  731.             move.w    #$0501,d0
  732.             dc.w     $A816
  733.         EndM
  734.     ELSE
  735.         IMPORT    AERemoveSpecialHandler
  736.     ENDIF
  737.  
  738.     IF GENERATING68K THEN
  739.         Macro
  740.         _AEGetSpecialHandler
  741.             move.w    #$052D,d0
  742.             dc.w     $A816
  743.         EndM
  744.     ELSE
  745.         IMPORT    AEGetSpecialHandler
  746.     ENDIF
  747.  
  748. ;*************************************************************************
  749. ;  This call was added in version 1.0.1. If called with the keyword
  750. ;  keyAERecorderCount ('recr'), the number of recorders that are
  751. ;  currently active is returned in 'result'.
  752. ;*************************************************************************
  753. ; available only in vers 1.0.1 and greater 
  754.     IF GENERATING68K THEN
  755.         Macro
  756.         _AEManagerInfo
  757.             move.w    #$0441,d0
  758.             dc.w     $A816
  759.         EndM
  760.     ELSE
  761.         IMPORT    AEManagerInfo
  762.     ENDIF
  763.  
  764.     ENDIF ; __APPLEEVENTS__
  765.